<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 15-8-10
 * Time: 下午2:04
 */
class ExpressModel extends MY_Model {

    /*获取自定定于运费模板列表*/
    public function getExpressCostList($exprssid = "")
    {
        $sqlInfo = array(
            'table' => 'express_cost',
            'where' =>array(),
            'order'=>array(
                'cost_id asc',
            ),
        );
        if (!empty($exprssid)) {
            $sqlInfo['where'] = array(
                'express_id in ('.$exprssid.')',
            );
        }
        $list = $this->CoreSelect($sqlInfo);
        return $list;
    }
    /*获取省份列表*/
    public function getProvince($provinceId = ''){
        $sqlInfo = array(
            'table' => 'china_province',
            'where' => array(),
        );
        if(!empty($provinceId)){
            $sqlInfo['where'] = array(
                'province_id = "'.$provinceId.'"'
            );
        }
        $list = $this->CoreSelect($sqlInfo);
        return empty($list) ? array() : $list;
    }

    /*获取城市列表*/
    public function getCity($provinceId = ''){
        $sqlInfo = array(
            'fields' => array(
                'city_id',
                'city_name',
            ),
            'table' => 'china_city',
            'where' => array(),
        );
        if(!empty($provinceId)){
            $sqlInfo['where'] = array(
                'province_id = "'.$provinceId.'"'
            );
        }
        $list = $this->CoreSelect($sqlInfo);
        return empty($list) ? array() : $list;
    }

    /*获取地区列表*/
    public function getArea($cityId = ''){
        $sqlInfo = array(
            'fields' => array(
                'area_id',
                'area_name',
            ),
            'table' => 'china_area',
            'where' => array(),
        );
        if(!empty($cityId)){
            $sqlInfo['where'] = array(
                'city_id = "'.$cityId.'"'
            );
        }
        $list = $this->CoreSelect($sqlInfo);
        return empty($list) ? array() : $list;
    }
}

/* End of file expressmodel.php */
/* Location: ./application/model/lib/expressmodel.php */